package org.jeecg.modules.rental.enums;


import org.jeecg.common.annotation.EnumDict;
import org.jeecg.common.enums.IEnumDict;
import org.jeecg.common.exception.JeecgBootException;

@EnumDict(code ="fault_status_dict", name = "故障处理状态类型")
public enum FaultStatusDictEnums implements IEnumDict<FaultStatusDictEnums> {
    TODO("0", "待处理","1"),
    DOING("1", "处理中", "2"),
    RESOLVED("2", "已解决", "3"),
    CLOSED("3", "已关闭", "4");

    private String value;

    private String label;

    /**
     * 不一定要有，为了前端vue渲染有个key
     */
    private String key;

    FaultStatusDictEnums(String value, String label, String key) {
        this.value = value;
        this.label = label;
        this.key = key;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public String getRemark() {
        return null;
    }

    public static FaultStatusDictEnums getEnumByValue(String value){
        for(FaultStatusDictEnums item: values()){
            if(value.equals(item.value)){
                return item;
            }
        }
        throw new JeecgBootException("没找到对应字典");
    }


}
